package com.reading_recognition_system.mapper;

import com.reading_recognition_system.pojo.User;
import org.apache.ibatis.annotations.*;


@Mapper
public interface UserMapper {
    @Select("select * from user where usercode=#{usercode} and password=#{password}")
    public User findUser(@Param("usercode") String usercode,@Param("password") String password);
    @Select("select * from user where u_id=#{u_id}")
    public User findOne(@Param("u_id") int u_id);
    @Update("update user set username=#{username},sex=#{sex},age=#{age},birthday=#{birthday},address=#{address},u_portrait=#{uPortrait},contact=#{contact},u_profile=#{uProfile},u_time=#{uTime} where u_id=#{uId}")
    public Integer updateUser(User user);
    @Insert("insert into user(usercode,password) values(#{usercode},#{password})")
    public Integer insertUser(@Param("usercode") String usercode,@Param("password") String password);
    @Delete("delete from user where u_id=#{u_id}")
    public Integer deleteUser(@Param("u_id") int u_id);
}
